home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Source Code / C / Code Resources / CDEF - DeBugger 2.0.2 / splash.c < prev    next >
Encoding:
Text File  |  1995-10-19  |  1.6 KB  |  65 lines  |  [TEXT/KAHL]

  1.  
  2.  
  3. // Prototypes
  4.     void    CreateMySplashWindow( void );
  5.  
  6. // Macros & stuff
  7.     #define    SPLASH_WINDOW    128
  8.     
  9. /****************************************************************************
  10.  
  11.     This is a simple little procedure for displaying my stupid looking
  12.     splash screen. It's used when a user selects "about" in the apple
  13.     menu.
  14.  
  15. *****************************************************************************/
  16. void    CreateMySplashWindow( void )
  17. {
  18.     DialogPtr    splash_dialog;
  19.     GrafPtr        oldPort;
  20.     short        itemHit, iType;
  21.     Handle        iHandle;
  22.     Rect        iRect;
  23.     PicHandle    thePicture;
  24.     
  25.     // Get my splash dialog
  26.         splash_dialog = GetNewDialog( SPLASH_WINDOW, 0, (WindowPtr)-1 );
  27.         GetPort( &oldPort );
  28.         SetPort( splash_dialog );
  29.     
  30.     // simple procedure to frame the 'ok' button
  31.         GetDItem( splash_dialog, 1, &iType, &iHandle, &iRect );
  32.         PenSize( 3, 3 );
  33.         InsetRect( &iRect, -4, -4 );
  34.         FrameRoundRect( &iRect, 16, 16 );
  35.     
  36.     // Are we color?
  37.         if( GetDepth( splash_dialog ) > 4 ) {
  38.             thePicture = GetPicture( 129 );
  39.         } else {
  40.             thePicture = GetPicture( 128 );
  41.         }
  42.     
  43.     // Draw the correct picture
  44.         SetRect( &iRect, 7, 7, 303, 148 );
  45.         DrawPicture( thePicture, &iRect );
  46.     
  47.     // Set our font stuff up and draw the version string
  48.         TextFont( 9 );
  49.         TextSize( 9 );
  50.         MoveTo( 13, 195 );
  51.         DrawString( "\pVersion 2.0.2  10/95" );        // my version string
  52.     
  53.     // Do a modal dialog and wait for user interaction.
  54.         do { 
  55.             ModalDialog( 0, &itemHit );
  56.             switch( itemHit ) {
  57.                     case ok:
  58.                         break;
  59.                 }
  60.         } while( itemHit != 1 );
  61.     
  62.     // The user hit ok. So get rif of the dialog and set things back to abby-normal.
  63.         DisposeDialog( splash_dialog );
  64.         SetPort( oldPort );
  65. }